#include "StdAfx.h"

#include <PSDFCore/Network/NetworkDataRecognizer.h>
#include <PSDFCore/Event/EventCenter.h>

const unsigned int NETWORK_GROUP = generateCustomEventGroup();
const unsigned int	  DEFAULT_NETWORK_DATA = NETWORK_GROUP | 0;

int DefaultDataRecognizer::recognize( char* data, int length ) const
{
	TOUCH(length);

	int dataType;
	memcpy(&dataType, data, sizeof(int));

	return dataType;
}

void DefaultDataRecognizer::triggerDataEvent( int dataType, int dataIndex ) const
{
	EventCenter::inst()->triggerEvent(DEFAULT_NETWORK_DATA, dataType, dataIndex);
}
